import request from '@/router/axios';
import {baseUrl} from '@/config/env';

export const getCountry = () => {
  return request({
    url: baseUrl + '/api/region/getCountry',
    method: 'get',
    params: {
      limit:0,
    }
  })
}

export const getProvince = (page, limit, params) => {
  return request({
    url: baseUrl + '/api/region/getProvince',
    method: 'get',
    params: {
      key:params.province==undefined?'':params.province,
      type:params.countryId==undefined?'':params.countryId,
      page,
      limit,
    }
  })
}

export const getCity = (page, limit, params) => {
  return request({
    url: baseUrl + '/api/region/getCity',
    method: 'get',
    params: {
      key:params.city==undefined?'':params.city,
      type:params.provinceId==undefined?'':params.provinceId,
      page,
      limit,
    }
  })
}